<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<chiptrack:checkLogon sourcePage="/operationCodeEntry.do"/>
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>
<%
try
{

%>
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>

<HTML><HEAD>
<TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href='<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css' type='text/css' rel='stylesheet'>
<Script Language="javascript">

function save()
{

  var oprCode  = document.operationCodeEntryform["operationCode"];
  var oprDesc  = document.operationCodeEntryform["oprationCodeDesc"];
  var process  = document.operationCodeEntryform["process"];
  var pa	   = document.getElementById("message");
  pa.innerHTML = "";

  if( typeof oprCode.length == 'undefined')
  {
     if( oprCode.value.trim() != '' && oprDesc.value.trim() != '' && process.value.trim() == '')
     {

        pa.innerHTML  = "<li>" + "Select Process Type" + "</li>";
        process.focus();
        return;

     }
     if( oprCode.value.trim() != '' && process.value.trim() != '' && oprDesc.value.trim() == '')
     {

        pa.innerHTML  = "<li>" + "Enter Code Full Description" + "</li>";
        oprDesc.value = '';
        oprDesc.focus();
        return;

     }
     if( oprDesc.value.trim() != '' && process.value.trim() != '' && oprCode.value.trim() == '')
     {
        pa.innerHTML  = "<li>" + "Enter Operation Code" + "</li>";
        oprCode.value = '';
        oprCode.focus();
        return;
     }
     if( oprDesc.value.trim() != '' && oprCode.value.trim() == '')
     {
        pa.innerHTML  = "<li>" + "Enter Operation Code" + "</li>";
        oprCode.value = '';
        oprCode.focus();
        return;
     }
     if( oprDesc.value.trim() == '' && oprCode.value.trim() != '')
     {
        pa.innerHTML  = "<li>" + "Enter Code Full Description" + "</li>";
        oprDesc.value = '';
        oprDesc.focus();
        return;
     }
     if( process.value.trim() != '' && oprCode.value.trim() == '' && oprDesc.value.trim() == '')
     {
        pa.innerHTML  = "<li>" + "Enter Operation Code" + "</li>";
        oprCode.value = '';
        oprCode.focus();
        return;
     }
     if( process.value.trim() == '' && oprCode.value.trim() == '' && oprDesc.value.trim() == '')
     {
        pa.innerHTML  = "<li>" + "Enter Operation Code Details" + "</li>";
        return;
     }
    if( !isInteger(oprCode.value) )
    {
        pa.innerHTML = "Please enter valid Operation Code,Operation Code must be number";
        oprCode.focus();
        return;
    }
  }

  document.operationCodeEntryform.action="<%=chipTracContext%>/operationCodeEntry.do?action=save" ;
  document.operationCodeEntryform.submit();
}
</Script>
</HEAD>
<BODY bgColor='#ffffff' leftMargin='0' topMargin='0' marginheight='0' marginwidth='0'>

<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
    <td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>
    <!-- Side Navigation start -->
    <%@ include file="/jsp/operations/dataentryMenu.jsp" %>
    <!-- end of the side navigations -->
    <TD bgcolor="#ffffff">
    <IMG height=9 src="images/spacer.gif" width=8></TD>
    <TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
    <TD valign="top" width="100%">
    <IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
    <BR>
<!-- form start here-->
    <html:form name="operationCodeEntryform" type="com.scalar.chiptrack.operations.dataentry.forms.OperationCodeEntryForm" action ="/operationCodeEntry" >
        <center><span class="NArialW">Operation Code Entry</span></center>
        <img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20>
        <table border="0" width="90%" align="center" >
            <tr>
                <td colspan="3" class='NArialL'>&nbsp;<strong><FONT id="message" styleClass="NArialL" color='FF0000'></FONT></td>
            </tr>
            <tr>
                <td colspan="3">&nbsp;</td>
            </tr>
            <tr>
                <td colspan="3">
                    <chiptrack:info styleClass="NArialL" />
                    <chiptrack:errors styleClass="NArialL" />
                    <chiptrack:messages type="info" styleClass="NArialL" />
                </td>
            </tr>
            <table border="0" width="60%" align="center" id="partDisplayTable">
            <tr bgcolor="#993333" align = "center">
                <td width="10%"><font class='NArialL'><font color="#FFFFFF">Operation Code</font></font> </td>
                <td width="30%"><font class='NArialL'><font color="#FFFFFF">Code Full Description</font></font> </td>
                <td width="20%"><font class='NArialL'><font color="#FFFFFF">Process</font></font> </td>
            <tr>
            <tr>
                <td width="10%"><font class="NArialL">
                    <html:text name="operationCodeEntryform"  property="operationCode" size="25" styleClass="valuetxfield" maxlength="4" />
                    </font>
                </td>
                <td width="30%"><font class='NArialL'>
                    <html:text name="operationCodeEntryform"  property="oprationCodeDesc" size="25" styleClass="txfield" maxlength="50" />
                    </font>
                </td>
                <td width="20%">
                    <font class='NArialL'>
                        <html:select name="operationCodeEntryform" property="process"  styleClass="txfield" >
                             <html:option value="">--Select Process Type---</html:option>
                            <html:options collection="processList" property="label" labelProperty="label"></html:options>
                        </html:select>
                    </font>
                </td>
            <tr>
            <tr>
                <td colspan="3"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td>
            </tr>
            <tr>
                <td colspan=3" align=center>
                <a href="javascript:save();"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/save.gif" width="53" height="17" onmouseover="window.status='Click to Save Operation Code Details';return true" onmouseout="window.status='';return true" title="Click here to Save Operation Code Details"></a>
                &nbsp;
                <a href="<%=chipTracContext%>/operationCodeList.do"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/cancel.gif" width="53" height="17" onmouseover="window.status='Click to Cancel Changes';return true" onmouseout="window.status='';return true" title="Click here to Cancel Changes"></a>
                </td>
            </tr>
         </table>
      </table>
   </html:form>
<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->
</table>
</BODY>
</HTML>

<%
}
catch(Exception e)
{
    e.printStackTrace();
}


%>